package com.erp.app.common.query;

import com.erp.app.setup.dept.pk.DeptHdrPk;

public class DeptQuery extends BeanQuery {

	public DeptQuery() {
        super(	" SELECT DEPT_CODE, DEPT_NAME FROM T_DEPT_HDR WHERE "
        		+ " COMPANY_CODE = `companyCode:string` "
        		+ " AND (STATUS = `$GENERIC_ACTIVE:string` "
        		+ "       OR DEPT_CODE = `deptCode:string`) "
        		+ " ORDER BY DEPT_NAME ");
   }

   public DeptQuery setDeptHdrPk(DeptHdrPk deptHdrPk) {
       this.setModel(deptHdrPk);
       return this;
   }

   public DeptQuery setCompanyCode(String companyCode) {
       return this.setDeptHdrPk(new DeptHdrPk(companyCode, null));
   }

}
